﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using DataModel;
using System.Web.UI.HtmlControls;

public partial class Guest_Help : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string control = string.Empty;
        using (DefaultEntityConnection connection = new DefaultEntityConnection())
        {
            foreach (Help help in connection.Helps)
            {
                control += string.Format(@"<article class=""span12"">
              <h3>{0}</h3>
              <div class=""wrapper"">
                <figure class=""img-indent""><img  src=""{1}"" /></figure>
                <div class=""inner-1 overflow extra"">
                  <div class=""txt-1""> {2}</div>                                                                 
                  <a href=""{3}"">بیشتر بخوانید</a>         
                </div>
                <div class=""border-horiz""/>
              </div>
              </article>                 
                    ", help.HelpTitle, string.Format("Images/Help/{0}", help.ImageUrl), help.Description, string.Format("Files/Help/{0}", help.FileUrl));
            }
        }
        if (control != string.Empty)
        {
            HtmlGenericControl div = new HtmlGenericControl();
            div.ID = "body1";
            div.InnerHtml = control;
            helpDiv.Controls.Add(div);
        }
    }
}